package kr.hkit.powerjava.chapter07;

import java.util.Scanner;

public class Work03 {
	public static void main(String[] args) {
		int gubun=-1;
		int age=0;
		int hour=0;
		int price = 0;
	
		
	
/*		Scanner sc = new Scanner(System.in);
		System.out.print("1)자유이용권  2)입장권");
		gubun = sc.nextInt();
		System.out.print("나이를 입력하세요 : ");
		age = sc.nextInt();
		System.out.println("현재의 시간을 입력하세요 : ");
		time = sc.nextInt();*/
		
		System.out.println(getPrice(1, 24, 14));
		System.out.println(getPrice(2,10,15));
		

	}
	private static int getPrice(int gubun, int age, int hour){
		int price =-1;	
		if(gubun == 1){
			if(hour < 17){
				if(age < 3){
					price = 0;
				}
				else{
					if((age<13 || age>65)){
					price = 25000;
					}
					else{
					price = 34000;
					}
				}
			}
			else{
				if(age<3){
					price = 0;
				}
				else{
					if((age<13 || age>65)){
					price = 21000;
					}
					else{
					price = 29000;
					}
				}
			}	
			
		}
		else
			if(hour < 17){
				if(age<3){
					price = 0;
				}
				else{
					if((age<13 || age>65)){
					price = 20000;
					}
					else{
					price = 27000;
					}
				}
			}
			else{
				if(age<3){
					price = 0;
				}
				else{
					if((age<13 || age>65)){
						price = 17000;
					}
					else{
						price = 23000;
					}
				}
			}
		return price;
		
	}
	
}